CREATE TABLE `SRTrade`.`MsgSRAwayExecution` (
`accnt` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR accnt',
`clientFillId` BIGINT NOT NULL DEFAULT 0 COMMENT 'client fill ID (should be unique for each accnt)',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`fillNumber` BIGINT NOT NULL DEFAULT 0 COMMENT 'SpiderRock execution number (globally unique over trailing 10 days) [copied in SpdrParentExecution.pkey.fillNumber]',
`engineName` VARCHAR(32) NOT NULL DEFAULT '',
`spdrSource` ENUM('None','SpdrTicket','SpdrSingle','SRSE','FIX','HedgeTool','TradeHedge','OpenHedge','AutoHedge','Orphan','RiskManager','OrderManager','ManagedOrder','RFQRespSrvr','Legger','SRSEDrop','FixDrop','TicketDrop','SysTest','RFRResponse','AllocOmni','AllocClient','CertGateway','MLegResponse','LeggerX','DropManager','AutoHedgeSrvr','AuctionStrategySrvr','AllocBlockFace','AllocBlockCust','IceChatGateway','EXS2SRC','MLinkResponse','AutoResponderVD','AutoResponderRC','AutoResponderSN','AutoResponderBX','MLink') NOT NULL DEFAULT 'None' COMMENT 'SR source code',
`execStatus` ENUM('None','Fill','Bust','Correct','Reject','SysRej') NOT NULL DEFAULT 'None' COMMENT 'SR execution status (Fill,Bust,Correct,Reject)',
`clientOrderId` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'client order ID (should be unique for each clientFirm) (if any) [copied into SpdrParentExecution.altOrderId]',
`srcRoutingCode` TINYTEXT NOT NULL DEFAULT '' COMMENT 'inbound FIX routing code (drop server) (if any)',
`riskGroupId` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'riskGroupId (parent order group ID) for this away execution report (will be incorporated into a corresponding EE risk group counter if != 0)',
`secKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'SR security key',
`secKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'SR security key',
`secKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'SR security key',
`secKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'SR security key',
`secKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'SR security key',
`secKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'SR security key',
`secKey_xx` DOUBLE NOT NULL DEFAULT 0 COMMENT 'SR security key',
`secKey_cp` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call' COMMENT 'SR security key',
`secType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None' COMMENT 'SR security type [Stock, Future, Option]',
`execRole` ENUM('None','DirectAccnt','AwayGiveup','RiskDrop','AwayDrop','PullDrop') NOT NULL DEFAULT 'None' COMMENT 'SpiderRock relationship to this execution record',
`extExecBroker` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'Client execBroker code',
`fillSide` ENUM('None','Buy','Sell') NOT NULL DEFAULT 'None' COMMENT 'fill side',
`fillPrice` DOUBLE NOT NULL DEFAULT 0 COMMENT 'fill price',
`fillPriceType` ENUM('None','Explicit','Offset','Zero') NOT NULL DEFAULT 'Explicit',
`fillQuantity` INT NOT NULL DEFAULT 0 COMMENT 'fill quantity',
`childSize` INT NOT NULL DEFAULT 0 COMMENT 'child order size',
`fillExch` VARCHAR(6) NOT NULL DEFAULT '' COMMENT 'fill exchange (if any)',
`fillDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'fill date/time',
`fillRefUPrc` DOUBLE NOT NULL DEFAULT 0 COMMENT 'reference underlier price @ fill arrival time',
`origExecID` TINYTEXT NOT NULL DEFAULT '' COMMENT 'original execution ID string (child order)',
`lastExecID` TINYTEXT NOT NULL DEFAULT '' COMMENT 'most recent execution ID (same as origExecID unless CANCEL/CORRECTION has been processed)',
`fillTransactDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'transaction date/time as reported by exchange or down stream broker',
`fillReportDetail` TINYTEXT NOT NULL DEFAULT '' COMMENT 'extra detail (if any) from child execution',
`ssaleFlag` ENUM('None','Long','Short','Exempt','Cover','NA') NOT NULL DEFAULT 'None',
`positionType` ENUM('None','Opening','Closing') NOT NULL DEFAULT 'None',
`theoVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'client supplied theoretical volatility (used for markup only)',
`comment` TINYTEXT NOT NULL DEFAULT '' COMMENT 'text comment (if any)',
`userData1` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`userData2` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`strategy` VARCHAR(36) NOT NULL DEFAULT '' COMMENT 'client-supplied strategy string',
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'user who last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'timestamp of last modification',
CONSTRAINT nonnegative_riskGroupId CHECK(ASCII(riskGroupId) < 56),
PRIMARY KEY USING HASH (`accnt`,`clientFillId`,`clientFirm`),
KEY `AccntIndex` (`accnt`) USING HASH,
KEY `ClientFirmIndex` (`clientFirm`) USING HASH,
KEY `FillNumberIndex` (`fillNumber`) USING HASH
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='SpdrAwayExecution records are published by ToolServers, SRSE, and FIX drop recv gateways. They are consumed by AwayExecutionMarkupServer which, in turn, publishes corresponding SpdrParentExecution records, including M1 and M10 updates.';